import { useRef } from "react";
import { MdRefresh } from "react-icons/md";
interface RestartButtonProps {
  onRestart: () => void;
  className?: string;
}
const RestartButton = ({
  onRestart: handleRestart,
  className,
}: RestartButtonProps) => {
  const buttonRef = useRef<HTMLButtonElement>(null);
  const handleClick = () => {
    buttonRef.current?.blur();
    handleRestart();
  };
  return (
    <button
      ref={buttonRef}
      className={`block rounded px-8 hover:bg-slate-700/50 ${className}`}
      onClick={() => {
        handleClick();
      }}
    >
      <MdRefresh className="w-6 h-8" />
    </button>
  );
};
export default RestartButton;
